package com.ers.modelconvert;

import java.util.Date;

import com.ers.model.Job;
import com.ers.validmodel.JobModel;

public class JobConvert {
	public static Job toJob(JobModel jm){
		Job job = new Job();
		job.setDeadline(jm.getDeadline());
		job.setDescription(jm.getDescription());
		job.setEducation(jm.getEducation());
		job.setExperience(jm.getExperience());
		job.setId(jm.getId());
		job.setIndustry(jm.getIndustry()); 
		job.setMailbox(jm.getMailbox());
		job.setMajor(jm.getMajor());
		job.setPosition(jm.getPosition());
		job.setPublishTime(new Date());
		job.setSalary(jm.getSalary());
		job.setWorkplace(jm.getWorkplace());
		job.setHot(jm.getHot());
		return job;
	}
	
	public static JobModel toJobModel(Job jm){
		JobModel job = new JobModel();
		job.setDeadline(jm.getDeadline());
		job.setDescription(jm.getDescription());
		job.setEducation(jm.getEducation());
		job.setExperience(jm.getExperience());
		job.setId(jm.getId());
		job.setIndustry(jm.getIndustry());
		job.setMailbox(jm.getMailbox());
		job.setMajor(jm.getMajor());
		job.setPosition(jm.getPosition());
		job.setPublishTime(jm.getPublishTime());
		job.setSalary(jm.getSalary());
		job.setWorkplace(jm.getWorkplace());
		job.setHot(jm.getHot());
		return job;
	}
	
}
